<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/statics/css/sapar.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/statics/css/common.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/statics/css/bootstrap.min.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/jquery.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/sapar.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/WdatePicker.js"></script>
<title>供应商明细</title>
</head>
<body>
	<div id="saper-container">
		<div id="saper-hd"></div>
		<div id="saper-bd">
			<div class="subfiled clearfix">
				<h2>供应商明细</h2>
			</div>
			<div class="subfiled-content">
				<div class="tab-container" data-trigger="click">
					<div class="tab">
						<!--<a href="javascript:;" class="current">审核中</a>
							<a href="javascript:;">审核通过</a>
							<a href="javascript:;">审核未通过</a>
							<a href="javascript:;">已取消</a>
							<a href="javascript:;">全部</a>-->
					</div>
					<div class="tab-content">
						<div class="tab-content-item">
							<form name="f1" id="f1"
								action="${pageContext.request.contextPath }/getSupplierList.do"
								method="post">
								<div class="search-box clearfix">
									<div class="kv-item clearfix" style="float: left;">
										<div class="kv-item-content">
											<a href="#mymodal2" data-toggle="modal"
												class="btn btn-primary">新增供应商明细</a>
										</div>
										<label>供应商：</label>
										<div class="kv-item-content">
											<input type="text" name="supplier_name" /> <input
												type="submit" value="查询" />
										</div>
									</div>
								</div>
							</form>
						</div>

						<!--表格开始-->
						<div class="table">
							<!--表格具体内容-->
							<div class="table-box">
								<table>
									<thead>
										<tr>
											<th>序号</th>
											<th>供应商编号</th>
											<th>供应商名称</th>
											<th>联系电话</th>
											<th>供应商类型</th>
											<th>供应商地址</th>
											<th>供应商状态</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${supplierList}" var="lists" varStatus="sta">
											<tr ${sta.index%2!=0?'style="background-color: #EFF6FA;"':''}>
												<td>${sta.index+1}</td>
												<td>${lists.supplier_id}</td>
												<td>${lists.supplier_name}</td>
												<td>${lists.supplier_telephone}</td>
												<td><c:if test="${lists.suppliertype_id eq 1}">配件供应商</c:if>
													<c:if test="${lists.suppliertype_id eq 2}">其他供应商</c:if></td>
												<td>${lists.supplier_address}</td>
												<td><c:if test="${lists.supplier_status eq 0}">启用</c:if>
													<c:if test="${lists.supplier_status eq 1}">禁用</c:if></td>
												<td><a
													href="${pageContext.request.contextPath }/getSupplierId.do?supplier_id=${lists.supplier_id}">修改</a>
													<a
													href="${pageContext.request.contextPath }/deleteSupplier.do?supplier_id=${lists.supplier_id}">删除</a></td>
											</tr>
										</c:forEach>
										<tr>
											<td colspan="13">
												<div align="right">
													<span>共${pages.totalCount }条记录${pages.currentPageNo}/${pages.totalPageCount }页</span>
													<c:if test="${pages.currentPageNo > 1}">
														<a href="javascript:page_nav(document.forms[0],1);">首页</a>
														<a
															href="javascript:page_nav(document.forms[0],${pages.currentPageNo-1});">上一页</a>
													</c:if>
													<c:if test="${pages.currentPageNo < pages.totalPageCount }">
														<a
															href="javascript:page_nav(document.forms[0],${pages.currentPageNo+1 });">下一页</a>
														<a
															href="javascript:page_nav(document.forms[0],${pages.totalPageCount });">最后一页</a>
													</c:if>
												</div>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div id="saper-ft"></div>

	<!--弹出的模态框-->
	<div id="mymodal2" class="modal fade">
		<!-- modal固定布局，上下左右都是0表示充满全屏，支持移动设备上使用触摸方式进行滚动。。-->
		<div class="modal-dialog modal-lg">
			<!-- modal-dialog默认相对定位，自适应宽度，大于768px时宽度600，居中-->
			<div class="modal-content">
				<form action="${pageContext.request.contextPath }/addSupplier.do"
					method="post" enctype="multipart/form-data">
					<!-- modal-content模态框的边框、边距、背景色、阴影效果。-->
					<div class="modal-header">
						<button class="close" data-dismiss="modal">&times;</button>
						<center>
							<h3 class="modal-title">新增供应商明细</h3>
						</center>
					</div>
					<div class="media-body">
						<div class="addjiejidan">
							<center>
								<table bordercolor="lightgray" border="2">
									<tr align="right">
										<td>供应商名称</td>
										<td><input type="text" class="form-control"
											name="supplier_name" /></td>
										<td>供应商类型</td>
										<td><select class="form-control" name="suppliertype_id">
												<option value="-1">请选择</option>
												<option value="1">配件供应商</option>
												<option value="2">其他供应商</option>
										</select></td>
									</tr>
									<tr align="right">
										<td>联系电话</td>
										<td><input type="text" class="form-control"
											name="supplier_telephone" /></td>
										<td>开户银行</td>
										<td><input type="text" class="form-control"
											name="supplier_bank" /></td>
									</tr>
									<tr align="right">
										<td>开户账号</td>
										<td><input type="text" class="form-control"
											name="supplier_account" /></td>
										<td>开户人</td>
										<td><input type="text" class="form-control"
											name="account_name" /></td>
									</tr>
									<tr align="right">
										<td>供应商地址</td>
										<td colspan="4"><input type="text" class="form-control"
											name="supplier_address" /></td>
									</tr>
									<tr>
										<td>供应商状态</td>
										<td><select class="form-control" name="supplier_status">
												<option value="-1">请选择</option>
												<option value="0">启用</option>
												<option value="1">禁用</option>
										</select></td>
									</tr>
								</table>
							</center>
						</div>
					</div>
					<div class="modal-footer">
						<button class="btn btn-default" data-dismiss="modal">关闭</button>
						<input type="submit" value="新增" />
					</div>
				</form>
			</div>
		</div>
	</div>
	<script type="text/javascript"
		src='${pageContext.request.contextPath }/statics/js/jquery-1.12.4.js'></script>
	<script type="text/javascript"
		src='${pageContext.request.contextPath }/statics/js/bootstrap.js'></script>
	<script type="text/javascript">
		$('select').iSelect();
	</script>
</body>
</html>